package apiin

import (
	"github.com/gogf/gf/v2/encoding/gjson"
	"hotgo/internal/model/entity"
	"hotgo/internal/model/input/form"
)

type IntegralBenefitsInp struct {
	Lng float64 `json:"lng"     dc:"经度（114.038324）"`
	Lat float64 `json:"lat"     dc:"纬度（22.656084）"`
	form.PageReq
}

type IntegralBenefitsModel struct {
	ID            int64       `json:"id"        orm:"id" dc:"商品ID"`
	Name          string      `json:"name"      orm:"name" dc:"商品名称"`
	MainImage     *gjson.Json `json:"mainImage" orm:"main_image" dc:"商品主图"`
	Integral      float64     `json:"integral"  orm:"integral" dc:"积分价格"`
	Distance      float64     `json:"distance"  orm:"distance" dc:"距离(km)"`
	UserCount     int64       `json:"userCount" orm:"user_count" dc:"分享数量"`
	BenefitPoints *gjson.Json `json:"benefitPoints"     orm:"benefit_points"     dc:"商品利益点"`
	CanBuy        bool        `json:"canBuy"            orm:"can_buy"            dc:"是否可以购买"`
}

type ProductGroupBuyInp struct {
	Lng float64 `json:"lng"     dc:"经度（114.038324）"`
	Lat float64 `json:"lat"     dc:"纬度（22.656084）"`
	form.PageReq
}

type ProductGroupBuyModel struct {
	ID            int64       `json:"id"             dc:"团购ID"`
	StoreName     string      `json:"storeName"      dc:"商户名称"`
	MainImage     *gjson.Json `json:"mainImage"      dc:"商品主图"`
	ProductName   string      `json:"productName"    dc:"团购商品名称"`
	Distance      float64     `json:"distance"       dc:"距离(km)"`
	BenefitPoints *gjson.Json `json:"benefitPoints"  dc:"商品利益点"`
	CostPrice     float64     `json:"costPrice"      dc:"成本价"`
	SalePrice     float64     `json:"salePrice"      dc:"销售价"`
	Discount      int         `json:"discount"      dc:"折扣"`
}

type ProductInfoInp struct {
	ProductId    int64   `json:"productId"     dc:"商品ID"`
	ProductNewId int64   `json:"productNewId"  dc:"新人商品ID"`
	Lng          float64 `json:"lng"     dc:"经度（114.038324）"`
	Lat          float64 `json:"lat"     dc:"纬度（22.656084）"`
}

type ProductInfoModel struct {
	Id                  int64       `json:"id"                orm:"id"                 dc:"商品ID"`
	ProductNewId        int64       `json:"productNewId"      orm:"product_new_id"     dc:"新人商品ID"`
	Name                string      `json:"name"              orm:"name"               dc:"商品名称"`
	Description         string      `json:"description"       orm:"description"        dc:"商品描述"`
	MainImage           *gjson.Json `json:"mainImage"         orm:"main_image"         dc:"商品主图"`
	Images              *gjson.Json `json:"images"            orm:"images"             dc:"商品配图"`
	Type                int         `json:"type"              orm:"type"               dc:"商品属性类型：1-积分权益、2-积分电商、3-团购商品"`
	BenefitPoints       *gjson.Json `json:"benefitPoints"     orm:"benefit_points"     dc:"商品利益点"`
	CostPrice           float64     `json:"costPrice"         orm:"cost_price"         dc:"成本价"`
	SalePrice           float64     `json:"salePrice"         orm:"sale_price"         dc:"销售价"`
	Integral            float64     `json:"integral"          orm:"integral"           dc:"积分价格"`
	MarketPrice         float64     `json:"marketPrice"       orm:"market_price"       dc:"市场价格"`
	IntegralLogistics   float64     `json:"integralLogistics" orm:"integral_logistics" dc:"积分商品的物流价格"`
	Scene               int         `json:"scene"             orm:"scene"              dc:"适用场景：1-门店场景、2-电商场景"`
	MemberQuantityLimit int         `json:"memberQuantityLimit" orm:"member_quantity_limit"     dc:"会员限购数量"`
	QuantityLimit       int         `json:"quantityLimit"     orm:"quantity_limit"     dc:"限制数量"`
	MemberQuantity      int         `json:"memberQuantity"    orm:"member_quantity"    dc:"会员个人已购数量"`
	Quantity            int         `json:"quantity"          orm:"quantity"           dc:"个人已购数量"`
	Sales               int         `json:"sales"             orm:"sales"              dc:"销量"`
	CanBuy              bool        `json:"canBuy"            orm:"can_buy"            dc:"是否可购买"`
	MemberCanBuy        bool        `json:"memberCanBuy"      orm:"member_can_buy"     dc:"会员是否可购买"`
	RestrictionType     int         `json:"restrictionType"   orm:"restriction_type"   dc:"限购类型：0-无、1-时间周期、2-用户ID"`
	Cycle               int         `json:"cycle"             orm:"cycle"              dc:"时间周期：1-每天、2-每周、3-每月、4-每年"`
	Rules               string      `json:"rules"             orm:"rules"              dc:"规则说明"`
	BonusPoints         float64     `json:"bonusPoints"       orm:"bonus_points"       dc:"赠送积分"`
	ExchangeRatio       float64     `json:"exchangeRatio"     orm:"exchange_ratio"     dc:"人民币积分兑换比例"`
	Stores              []struct {
		Id            int64       `json:"id"            orm:"id"         dc:"ID"`
		Name          string      `json:"name"          orm:"name"       dc:"门店名称"`
		Address       string      `json:"address"       orm:"address"    dc:"门店地址"`
		Lat           float64     `json:"lat"           orm:"lat"        dc:"纬度"`
		Lng           float64     `json:"lng"           orm:"lng"        dc:"经度"`
		Phone         string      `json:"phone"         orm:"phone"      dc:"门店电话"`
		Distance      float64     `json:"distance"      orm:"distance"   dc:"距离(km)"`
		OldId         string      `json:"oldId"        orm:"old_id"      dc:"旧ID"`
		PublicityImgs *gjson.Json `json:"publicityImgs" orm:"publicity_imgs"         dc:"门店图片"`
		BusinessId    int64       `json:"businessId"      orm:"business_id"      dc:"商户ID"`
	} `json:"stores"      orm:"stores"      dc:"适用门店"`
}

type GetByProductIdInp struct {
	ProductId int64 `json:"productId"     dc:"商品ID"`
}

type GetByProductIdModel struct {
	entity.Product
}

type ProductNewListModel struct {
	Id            int64       `json:"id"                orm:"id"                 dc:"商品ID"`
	Name          string      `json:"name"              orm:"name"               dc:"商品名称"`
	MainImage     *gjson.Json `json:"mainImage"         orm:"main_image"         dc:"商品主图"`
	BenefitPoints *gjson.Json `json:"benefitPoints"     orm:"benefit_points"     dc:"商品利益点"`
	MarketPrice   float64     `json:"marketPrice"       orm:"market_price"       dc:"市场价格"`
	NewPrice      float64     `json:"newPrice"  orm:"new_price"  dc:"新人价格"`
}

type ProductNewExchangeHistoryModel struct {
	Nickname string `json:"nickname"  orm:"nickname"  dc:"微信昵称"`
	Name     string `json:"name"      orm:"name"      dc:"商品名称"`
}

type ProductGroupExchangeHistory struct {
	Nickname string `json:"nickname"  orm:"nickname"  dc:"微信昵称"`
	Name     string `json:"name"      orm:"name"      dc:"商品名称"`
	Avatar   string `json:"avatar"    orm:"avatar"    dc:"头像"`
}

type MemberCard struct {
	entity.MemberCard
}

type MemberCardDetailInp struct {
	Id int64 `json:"id"      description:"会员卡ID"`
}

type StoreInfoInp struct {
	Id  int64   `json:"id" v:"required#门店ID不能为空" dc:"门店ID"`
	Lng float64 `json:"lng"     dc:"经度（114.038324）"`
	Lat float64 `json:"lat"     dc:"纬度（22.656084）"`
}

type StoreInfoModel struct {
	*entity.Store
}

type StoreGroupBuyInp struct {
	ID int64 `json:"id" v:"required#门店ID不能为空" dc:"门店ID"`
	form.PageReq
}

type StoreGroupBuyModel struct {
	Id            int64       `json:"id"                orm:"id"                 description:"商品ID"`
	Name          string      `json:"name"              orm:"name"               description:"商品名称"`
	MainImage     *gjson.Json `json:"mainImage"         orm:"main_image"         description:"商品主图"`
	BenefitPoints *gjson.Json `json:"benefitPoints"     orm:"benefit_points"     description:"商品利益点"`
	MarketPrice   float64     `json:"marketPrice"       orm:"market_price"       description:"市场价格"`
	SalePrice     float64     `json:"salePrice"         orm:"sale_price"         description:"销售价"`
}

type SearchProductInp struct {
	KeyWord string `json:"keyWord"      description:"搜索内容"`
	form.PageReq
}

type SearchProductModel struct {
	Id            int64       `json:"id"                orm:"id"                 description:"商品ID"`
	Name          string      `json:"name"              orm:"name"               description:"商品名称"`
	MainImage     *gjson.Json `json:"mainImage"         orm:"main_image"         description:"商品主图"`
	Type          int         `json:"type"              orm:"type"               description:"商品属性类型：1-积分权益、2-积分电商、3-团购商品"`
	BenefitPoints *gjson.Json `json:"benefitPoints"     orm:"benefit_points"     description:"商品利益点"`
}

type GetStoreInfoInp struct {
	Id int64 `json:"id"      description:"商品ID"`
}

type GetStoreInfoModel struct {
	StoreId    int64 `json:"storeId"           description:"门店ID"`
	BusinessId int64 `json:"businessId"        description:"关联的商户ID"`
}
